// 封装banner轮播图相关的业务代码
import { ref, onMounted } from "vue";
import { getBannerApi } from "@/apis/bannerApi";

export function useBanner() {
  const bannerList = ref([]);
  //   获取数据并将获取的数据给bannerList
  const getBanner = async () => {
    const res = await getBannerApi({ distributionSite: 2 });
    bannerList.value = res.result;
  };
  //   调用获取数据的接口
  onMounted(() => getBanner());
  //   导出获取的banner数据
  return {bannerList};

}
